package com.inspiration.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.inspiration.entity.Content;
import com.inspiration.entity.dto.SearchContentDTO;
import com.inspiration.entity.vo.ContentVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ContentMapper extends BaseMapper<Content> {
    /**
     * 根据标签获取内容.
     * @param tid
     * @return
     */
    @Select(" select content.* from tag_content_relation inner join content on ( tcr_c_id = c_id ) " +
            " where tcr_t_id = #{tid} ")
    List<Content> listByTId(Long tid);

    List<Long> listBySearchContentDTO(SearchContentDTO contentDTO);

    List<ContentVO> listDetailsVO(List<Long> list);
}
